<include file="public@header"/>
<style>
    .col-sm-2{
        width: 10% !important;
    }
    .col-sm-offset-2{
        margin-left: 10% !important;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('AdminPage/index')}">页面管理</a></li>
        <li class="active"><a href="#" data-toggle="tab">编辑页面</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" role="form"
          action="{:url('portal/AdminPage/editPost')}">

        <div class="form-group">
            <label for="input-title" class="col-sm-2 control-label"><span class="form-required">*</span>类型</label>
            <div class="col-md-6 col-sm-10">
                <select name="type" class="form-control">
                    <option value="0">单页面</option>
                    <option value="2" <if condition="$post['type'] eq 2 ">selected</if>>个人中心展示</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="input-title" class="col-sm-2 control-label"><span class="form-required">*</span>标题</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="post_title" id="input-title" value="{$post.post_title|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label for="input-title" class="col-sm-2 control-label"><span class="form-required">*</span>内容</label>
            <div class="col-md-6 col-sm-12">
                <script type="text/plain" id="content" name="post_content">{$post.post_content|default=""|htmlspecialchars_decode}</script>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="hidden" name="id" value="{$post.id}">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="{:url('AdminPage/index')}">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    var editorcontent = new baidu.editor.ui.Editor();
    editorcontent.render('content');
</script>
</body>
</html>